package tpo.lmhprovider.lmhprovider.dao;

import dto.ShowWares;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import pojo.Album;
import pojo.Sort;
import pojo.Wares;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface WaresMapper {

    List<ShowWares> getWaresList(Map map);

    List<ShowWares> getWaresList2(Map map);

    List<ShowWares> getWaresList3(Map map);

    List<ShowWares> getWares(Map map);

    @Select("select * from wares where id=#{id}")
    List<Wares> getWares2(Map map);


    int updateWares(Wares wares);

    int addWares(Wares wares);

    @Update("update wares set isFlag=1 where id=#{id}")
    int delWares(Map map);

    List getSort(Map map);

    @Delete("delete from sort where id=#{id}")
    int delSort(Map map);

    @Update("update sort set sid=#{sid},level=#{level},name=#{name},log=#{log} where id=#{id}")
    int updateSort(Sort sort);

    @Insert("insert into sort (sid,level,name,log) values(#{sid},#{level},#{name},#{log})")
    int addSort(Sort sort);

    @Select("SELECT * FROM album WHERE waresId=#{waresId}")
    List<Album> getAlbum(Map map);

    int addAlbum(List<Album> list);

    @Delete("delete from album where id=#{id}")
    int delAlbum(Map map);

}
